From 47af28acacbdd63dd0330ac5762be788f061dc95 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 4 Jun 2001 20:31:51 +0000 Subject: [PATCH] patch from Szekeres Istvan, bug #52560 2001-06-04 Havoc Pennington * io-pnm.c (pnm_skip_whitespace): patch from Szekeres Istvan, bug #52560 --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/io-pnm.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 01771831b9..edeb03b1a5 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2001-06-04 Havoc Pennington + + * io-pnm.c (pnm_skip_whitespace): patch from Szekeres Istvan, + bug #52560 + 2001-06-01 Havoc Pennington Apply patch from sandmann@daimi.au.dk, with some tweaks. diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c index cd7dd9d9bd..dfa5cb3467 100644 --- a/gdk-pixbuf/io-pnm.c +++ b/gdk-pixbuf/io-pnm.c @@ -195,7 +195,14 @@ pnm_skip_whitespace (PnmIOBuffer *inbuf, GError **error) for ( ; inptr < inend; inptr++) { if (*inptr == '#') { /* in comment - skip to the end of this line */ - for ( ; *inptr != '\n' && inptr < inend; inptr++); + for ( ; *inptr != '\n' && inptr < inend; inptr++) + ; + + if ( *inptr != '\n' ) { + /* couldn't read whole comment */ + return PNM_SUSPEND; + } + } else if (!isspace (*inptr)) { inbuf->byte = inptr; inbuf->nbytes = (guint) (inend - inptr); -- 2.30.2